MasterMind A game of Diagnosis Strategies
نویسندگان
چکیده
The MasterMind game can be thought of as a diagnosis process where the analyst diagnoser by conducting speci c tests is trying to diagnose a hidden pattern fault The goal is to locate the pattern in a minimum time In this paper we introduce the Dynamic MasterMind in which the setter adversary has the right to change the hidden pattern provided that the new pattern does not con ict with previous responses Unlike the Static MasterMind the proposed game turns the setter to an active player and eliminates the possibility of breaking the hidden code accidentally We start the paper by presenting a formulation based on information theory of the MasterMind game In this formulation the setter is considered to be a zero memory information source producing messages in response to analyst guesses The amount of information from such messages based on a one step lookahead policy is de ned and used by the analyst to minimize the required number of guesses In this context two strategies are presented and evaluated In the rst based mainly on a MaxMin criterion the analyst tries the guess that in the worst case gives the maximum possible amount of information Next in an attempt to alleviate the e ect of the pool structure an averaging strategy based on the maximum Entropy is considered in which the analyst tries the guess that in the average gives the maximum possible amount of information The more complex L step lookahead strategies for both the static and dynamic games are left for future work The Static Mastermind Rules for the famous Mastermind game are extremely simple One player the setter selects a hidden combination of any N digits in the range to R repeats are allowed This hidden pattern is called the code The second player the analyst tries to uncover the code by a series of probes or guesses A guess like a code is any pattern of N digits from to R In response to each guess the setter must reply by saying how many digits of the probe are exact i e match the code in both value and relative position and how many are included i e are elements of the code but in wrong positions The round goes on until the analyst breaks the code i e has su cient amount of information to know the code Formulation The analyst starting with no information about the code must consider all the possible R patterns These patterns form the initial solution pool P After the i th round i the solution pool reduces to Pi Pi Obviously the i th guess is selected from that pool Let fG i G i G k i g Pi denote the set of possible i th guesses If guess Gki is proposed at the i round the new pool Pi consists of all those members of pool Pi which have not been eliminated by the i response from the setter That is pool Pi is the set of all patterns that might still be the code Therefore the goal of the analyst is to reduce some pool say Pm to a single element and the game ends when such a pool is found In this case we say that the game has ended after m rounds Optimal Guess and L step lookahead At any step i the analyst s goal is to minimize the number of guesses m required to break the code This however does not imply that the optimum guess is that yielding a new pool of minimum size As a matter of fact not only the size of this pool but also its structure i e the relative correlation of its members which can be estimated from the pool sizes further steps ahead must be considered Therefore an L step lookahead strategy should select the guess that optimizes the pool sizes L step further For example a two step lookahead strategy should select the guess Gki that optimizes the pool sizes of the i th step It is to be noted that in choosing the value of L the lookahead level the analyst is actually determining the number of levels to be considered from a large tree describing the course of the game for any guess and for any possible response In the rest of this paper we adopt a one step lookahead policy Strategies devised and results obtained may be easily extended to L step lookahead policies Information contents After the i round of the game the tuples Pi G k i R j i may be viewed as a message mi from an information source S The amount of information that the analyst gets from such messages namely I mi may be used to get from Pi a new pool Pi The greater I mi the smaller the size of the new pool will be Therefore in choosing guess Gki the analyst must try to maximize I mi Since Pi was previously computed in the i th round and since guess Gi will be uniquely speci ed in the i th round the set of possible messages from S is precisely the set of possible responses fR i R i R j i g from the setter Let R j i be the setter s i response The amount of information from mi Pi G k i R j i is I mi log Prob R j i Pi G k i bit s To calculate I mi we must nd the value of Prob Ri P j i G k i Any guess G k i imposes a partition on the set of patterns in Pi Each class in this partition corresponds to a possible response R i from the setter That is for a guess G k i the pool Pi may be expressed as the union of mutually disjoint sets or classes as follows Pi C k i R i C k i R i C k i R j i where C i R j i is simply the set of patterns in Pi resulting in a response R j i when compared to Gki Thus C k i R j i represents the next pool Pi if R j i is the response to G k i Therefore assuming that each pattern in Pi is equally likely to be the code the required probability is simply the ratio of the number of patterns in C i R j i to the total number of patterns in Pi Hence Prob mi Prob R j i Pi G k i jC i R j i j jPi j and I mi log jPi j jC i R j i j bit s It is to be noted that whichever guess is selected from the current pool a positive amount of information is always gained Thus the game always ends after a nite number of guesses m and it is the analyst s goal to minimize m The total amount of information required to identify the hidden pattern is log R N see Table Therefore the game will end after the m step if and only if
منابع مشابه
New solver and optimal anticipation strategies design based on evolutionary computation for the game of MasterMind
This paper presents and compares several evolutionary solutions for the well-known MasterMind game, a classic board game invented in the 1970’s. First, we propose a novel evolutionary approach (which we call nested hierarchical evolutionary search) to solve the MasterMind game, comparing the obtained results with that of existing algorithms. Second, we show how to design novel game anticipation...
متن کاملYet Another Mastermind Strategy
Over the years many easily computable strategies for the game of Mastermind have been proposed. In this paper we present a new strategy (at least to our knowledge) that performs better than the wellknown strategies: guess the code that has the highest number of possible answers. It is motivated and compared to four well-known strategies. Some empirical results are presented and discussed.
متن کاملSolving Mastermind Using Genetic Algorithms
Abstract. The MasterMind game involves decoding a secret code. The classic game is a code of six possible colors in four slots. The game has been analyzed and optimal strategies have been posed by computer scientists and mathematicians. In this paper we will survey previous work done on solving MasterMind, including several approaches using Genetic Algorithms. We will also analyze the solution ...
متن کاملMastermind is NP-Complete
In this paper we show that the Mastermind Satisfiability Problem (MSP) is NPcomplete. Mastermind is a popular game which can be turned into a logical puzzle called the Mastermind Satisfiability Problem in a similar spirit to the Minesweeper puzzle [5]. By proving that MSP is NP-complete, we reveal its intrinsic computational property that makes it challenging and interesting. This serves as an ...
متن کاملAdapting Heuristic Mastermind Strategies to Evolutionary Algorithms
The art of solving the Mastermind puzzle was initiated by Donald Knuth and is already more than 30 years old; despite that, it still receives much attention in operational research and computer games journals, not to mention the natureinspired stochastic algorithm literature. In this paper we try to suggest a strategy that will allow nature-inspired algorithms to obtain results as good as those...
متن کاملFinding an Evolutionary Solution to the Game of Mastermind with Good Scaling Behavior
The main research issue in the game of MasterMind is to find a method that minimizes the number of turns needed to find the solution. But another venue is to find a method that scale well when the size of the search space is increased. In this paper we will present a method that uses evolutionary algorithms to find fast solutions to the game of MasterMind that scale better with problem size tha...
متن کامل